package com.atguigu.study.controller;

import com.atguigu.study.service.ChatPersistenceAssistant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Marco
 * @Description
 * @date 2025/8/21 16:08
 * @email 3293336923@qq.com
 */
@RestController
public class ChatPersistenceController {

    @Autowired
    private ChatPersistenceAssistant   chatPersistenceAssistant;


    @GetMapping("/chat/test01")
    public       String      testChatPersistence(){

        chatPersistenceAssistant.prompt(7L , "你好，我的名字是 redis");
        chatPersistenceAssistant.prompt(8L , "你好，我的名字是nacos");

        String prompt1 = chatPersistenceAssistant.prompt(7L, "你好，我的名字是什么");
        String prompt2 = chatPersistenceAssistant.prompt(8L, "你好，我的名字是什么");

        return   "success:   prompt1: " + prompt1  + "<br>\n\n" +
                             "prompt2: " + prompt2;
    }

}
